<?php
if (!defined("_ECRIRE_INC_VERSION")) return;
global $tables_principales;

function pdk_declarer_tables_interfaces($interface){
	return $interface;
}

function pdk_declarer_tables_principales($tables_principales){
    // Products table
    $pdk_products = array(
		"id_product" 	=> "bigint(21) NOT NULL AUTO_INCREMENT",
        "titre" 	=> "varchar(255) NOT NULL",
        "prix" 	=> "float NOT NULL",
		"id_category" 	=> "bigint(21) NOT NULL",
        "maj" 	=> "timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
		);
	$pdk_products_key = array(
		"PRIMARY KEY"	=> "id_product"
		);
	$tables_principales['spip_pdk_products'] =
		array('field' => &$pdk_products, 'key' => &$pdk_products_key);
        
    // Products descriptions table
    $pdk_products_descriptions = array(
		"id_product" => "bigint(21) NOT NULL AUTO_INCREMENT",
		"short_desc" => "text NOT NULL",
        "full_desc" 	=> "text NOT NULL",
        "maj" 	=> "timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
		);
	$pdk_products_descriptions_key = array(
		"PRIMARY KEY"	=> "id_product"
		);
	$tables_principales['spip_pdk_products_descriptions'] =
		array('field' => &$pdk_products_descriptions, 'key' => &$pdk_products_descriptions_key);    
        
    // Orders products table
    $pdk_categories = array(
        "id_category" 	=> "bigint(21) NOT NULL AUTO_INCREMENT",
		"titre" 	=> "varchar(255) NOT NULL",
		"description" => "text NOT NULL",
        "maj" 	=> "timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"                
		);
	$pdk_categories_key = array(
        "PRIMARY KEY"=>"id_category",
		);
	$tables_principales['spip_pdk_categories'] =
		array('field' => &$pdk_categories, 'key' => &$pdk_categories_key);
  
    return $tables_principales;
}

?>